<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
    <div id="app">
      <p>{{arr}}</p>
      <p>{{object1}}</p>
      <button @click="Array1">数组修改</button>
      <button @click="Ojbect1">对象修改</button>
    </div>
    <script>
      let app = new Vue({
        el:'#app',
        data:{
          arr:[1,2,3,4,5],
          object1:{a:1}
        },
        methods:{
          Array1(){
            Vue.set(this.arr,2,'3被修改了')
          },
          Ojbect1 (){
            this.$set(this.object1,'b',"4")
          }
        }
      })
    </script>
</body>
</html>